<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: silence
  Date: 17-6-14
  Time: 下午8:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Pager Test</title>
</head>
<body>
<table>
    <tr>
        <th>id</th>
        <th>标题</th>
        <th>Money</th>
        <th>introduce</th>
    </tr>
    <c:forEach items="${pager.data}" var="bill">
        <tr>
            <td>${bill.id}</td>
            <td>${bill.title}</td>
            <td>${bill.money}</td>
            <td>${bill.introduce}</td>
        </tr>
    </c:forEach>
</table>

<hr>
<p>
    <c:if test="${pager.pageIndex != 1}">
        <a href="<c:url value="/pager/1"/>">首页</a>
    </c:if>

    <c:forEach begin="1" end="8" varStatus="status">
        <c:if test="${pager.pageIndex == status.index}">
            <span>${status.index}</span>
        </c:if>
        <c:if test="${pager.pageIndex != status.index}">
            <a href="<c:url value="/pager/${status.index}"/> ">${status.index}</a>
        </c:if>
    </c:forEach>

    <c:if test="${pager.totalPage != pager.pageIndex}">
        <a href="<c:url value="/pager/${pager.totalPage}"/> ">末页</a>
    </c:if>
</p>
</body>
</html>
